package com.zmn.oms.business.interfaces.log;

import com.zmn.oms.common.dto.OmsBaseOperator;
import com.zmn.oms.common.dto.OrderWorkRedistributeOperator;
import com.zmn.oms.model.dto.log.OrderRedistributeLogQuery;
import com.zmn.oms.model.entity.log.OrderLog;
import com.zmn.oms.model.entity.log.OrderRedistributeLog;
import com.zmn.oms.model.entity.redistribute.OrderWorkRedistributeApply;
import com.zmn.oms.model.entity.work.OrderWork;
import org.springframework.scheduling.annotation.Async;

import java.util.List;

/**
 * @author sunlife
 * @date:2022/5/13 下午7:21
 * description: 改派日志业务接口
 */
public interface OrderRedistributeLogBService {

    /**
     * 根据工单id 查询log
     *
     * @param workId
     * @return 日志list
     */
    List<OrderRedistributeLog> findOrderLogsByWorkId(Long workId);

    /**
     * 根据订单id 查询log
     *
     * @param orderLogQuery
     * @return 日志list
     */
    List<OrderRedistributeLog> findOrderLogsByQuery(OrderRedistributeLogQuery orderLogQuery);

    /**
     * 处理订单 log 员工数据
     *
     * @param baseLogList
     */
    void processLogStaffDept(List<OrderRedistributeLog> baseLogList);


    /**
     * 处理订单log 工程师数据
     * @param baseLogList
     * @param bizType
     */
    void processOrderLogMaster(List<OrderRedistributeLog> baseLogList, Integer bizType);

    /**
     * 保存
     *
     * @param log
     */
    void save(OrderRedistributeLog log);

    /**
     * 工单改派节点通知绩效系统
     * @param orderLog
     * @param orderWorkRedistributeApply
     */
    @Async
    void nodeNotice(OrderRedistributeLog orderLog, OrderWorkRedistributeApply orderWorkRedistributeApply);

    /**
     * 工单节点-通知改派申请取消
     * @param orderLog
     * @param dbOrderWork
     * @param omsBaseOperator
     * @param proceed
     */
    @Async
    void noticeCancelRedistribute(OrderLog orderLog, OrderWork dbOrderWork, OmsBaseOperator omsBaseOperator, Object proceed);

    /**
     * 改派流程节点通知
     * @param orderLog
     * @param orderWorkRedistributeOperator
     * @param orderWorkRedistributeApply
     */
    @Async
    void notice(OrderRedistributeLog orderLog, OrderWorkRedistributeOperator orderWorkRedistributeOperator, OrderWorkRedistributeApply orderWorkRedistributeApply);
}
